package com.airbnb.mvrx.sample.network

import com.airbnb.mvrx.sample.models.YTResponse
import io.reactivex.Observable
import retrofit2.http.*

interface BooklnService {
    /**
     * 'url is ', 'https://wxmini-prepub.bookln.cn/clickreadservice/querybybookid.do',
     * 'fetchObject is ', { timeout: 40000,
    method: 'POST',
    body:
    { _parts:
    [ [ '_appn', 'miniApp' ],
    [ '_appv', 87 ],
    [ '_tid', 'yvj5yki1dplo0iyv' ],
    [ '_appt', '1' ],
    [ '_channel', 'wxMinApp' ],
    [ '_appid', '10' ],
    [ '_templateid', 123 ],
    [ '_sign', '57d4c8' ],
    [ '_data', '{"bookId":1072}' ],
    [ '_ldv', 'b5918dbfec7bdc334a393195adaf2d70' ] ] } }
     */
    @FormUrlEncoded
    @POST("clickreadservice/querybybookid.do")
    fun fetchClickRead(@FieldMap() paramMap: MutableMap<String, Any>
    ): Observable<YTResponse>

    /**
     * 'url is ', 'https://dailys.bookln.cn/bookservice/bookhomedetail.do', 'fetchObject is ', { timeout: 30000,
    method: 'POST',
    body:
    { _parts:
    [ [ '_appn', 'miniApp' ],
    [ '_appv', 87 ],
    [ '_tid', 'y7j03kx9zxm3aay7' ],
    [ '_appt', '1' ],
    [ '_channel', 'wxMinApp' ],
    [ '_appid', '10' ],
    [ '_templateid', 124 ],
    [ '_sign', 'b69287' ],
    [ '_data', '{"bookId":3281}' ],
    [ '_ldv', '8c4573501b4047b469af35806140a988' ] ] } }
     */
    @FormUrlEncoded
    @POST("bookservice/bookhomedetail.do")
    fun fetchBookDetail(@FieldMap() paramMap: MutableMap<String, Any>
    ): Observable<YTResponse>


    /**
     *  [ '_data', '{"targetId":26842,"targetType":1}' ],
     */
    @FormUrlEncoded
    @POST("lessonservice/recommends.do")
    fun fetchLessonRecommend(@FieldMap() paramMap: MutableMap<String, Any>
    ): Observable<YTResponse>

    /**
     *  [ '_data', '{"bookId":26842}' ],
     */
    @FormUrlEncoded
    @POST("bookservice/recommend.do")
    fun fetchBookRecommend(@FieldMap() paramMap: MutableMap<String, Any>
    ): Observable<YTResponse>

}